home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / xml4j.jar / com / ibm / xml / dom / TextImpl.class (.txt) < prev   
Encoding:
Java Class File  |  1999-08-30  |  1.7 KB  |  65 lines

  1. package com.ibm.xml.dom;
  2.  
  3. import org.w3c.dom.DOMException;
  4. import org.w3c.dom.Node;
  5. import org.w3c.dom.Text;
  6.  
  7. public class TextImpl extends CharacterDataImpl implements Text {
  8.    static final long serialVersionUID = -5294980852957403469L;
  9.    protected boolean ignorableWhitespace;
  10.  
  11.    public TextImpl(DocumentImpl var1, String var2) {
  12.       super(var1, var2);
  13.    }
  14.  
  15.    public short getNodeType() {
  16.       return 3;
  17.    }
  18.  
  19.    public String getNodeName() {
  20.       return "#text";
  21.    }
  22.  
  23.    public Node cloneNode(boolean var1) {
  24.       return super.ownerDocument.createTextNode(((NodeImpl)this).getNodeValue());
  25.    }
  26.  
  27.    public void setIgnorableWhitespace(boolean var1) {
  28.       if (super.syncData) {
  29.          ((NodeImpl)this).synchronizeData();
  30.       }
  31.  
  32.       this.ignorableWhitespace = var1;
  33.    }
  34.  
  35.    public boolean isIgnorableWhitespace() {
  36.       if (super.syncData) {
  37.          ((NodeImpl)this).synchronizeData();
  38.       }
  39.  
  40.       return this.ignorableWhitespace;
  41.    }
  42.  
  43.    public Text splitText(int var1) throws DOMException {
  44.       if (super.readOnly) {
  45.          throw new DOMExceptionImpl((short)7, (String)null);
  46.       } else {
  47.          if (super.syncData) {
  48.             ((NodeImpl)this).synchronizeData();
  49.          }
  50.  
  51.          if (var1 >= 0 && var1 <= super.value.length() - 1) {
  52.             Text var2 = super.ownerDocument.createTextNode(super.value.substring(var1));
  53.             ((NodeImpl)this).setNodeValue(super.value.substring(0, var1));
  54.             if (super.parentNode != null) {
  55.                super.parentNode.insertBefore(var2, super.nextSibling);
  56.             }
  57.  
  58.             return var2;
  59.          } else {
  60.             throw new DOMExceptionImpl((short)1, (String)null);
  61.          }
  62.       }
  63.    }
  64. }
  65.